package wqh.service.impl;

import org.springframework.stereotype.Service;
import wqh.dao.MonitorDao;
import wqh.domain.Monitor;
import wqh.service.MonitorService;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by devts on 2016/9/26.
 */
@Service("monitorService")
public class MonitorServiceImpl implements MonitorService {

    @Resource
    private MonitorDao monitorDao;

    public List<Monitor> findAllRecord() {
        return this.monitorDao.findAllRecord();
    }

    public int updateRecord(Monitor monitor) {
        return this.monitorDao.updateRecord(monitor);
    }

    public int insertRecord(Monitor monitor) {
        return this.monitorDao.insertRecord(monitor);
    }

    public int deleteRecord(Integer id) {
        return this.monitorDao.deleteRecord(id);
    }

    public int updateDescriptionById(String description, Integer id) {
        return this.monitorDao.updateDescriptionById(description, id);
    }

    public int updateNameById(String name, Integer id) {
        return this.monitorDao.updateNameById(name, id);
    }

    public int updatePosById(String pos_x, String pos_y, Integer id) {
        return this.monitorDao.updatePosById(pos_x,pos_y,id);
    }

    public Monitor findAllById(Integer id) {
        return this.monitorDao.findAllById(id);
    }

    public List<Monitor> findAllByGeoLevel3(Integer id) {
        return this.monitorDao.findAllByGeoLevel3(id);
    }

    public List<Monitor> findAllByCode(String description) {
        return this.monitorDao.findAllByCode(description);
    }

    public List<Monitor> findAllByDeviceAndCode(Integer device_id, String code) {
        return this.monitorDao.findAllByDeviceAndCode(device_id,code);
    }

}
